<?php
include('/home/content/o/k/h/okh1234/html/test/wp-blog-header.php');
global $wpdb;

$result = $wpdb->get_results($wpdb->prepare("SELECT * FROM om_points WHERE name LIKE %s ORDER BY name ASC", '%'.$_REQUEST['searchText'].'%'),ARRAY_A);

if($result) {
	
} else {
	if($num_rows < 1)
	die("No results!");
	else
	die ("Couldn't connect!");
}
$tr = '<ul id="srchres">';
foreach($result as $r) {	
	$tr .= "<li><a onclick='displayMap(" . json_encode($r) . ")' href='javascript:void(0)'>" . $r["name"] . "</a></li>";
}
$tr .= "</ul>";

echo $tr;
//echo json_encode($rows, JSON_FORCE_OBJECT);
?>